﻿using Quartz;
using Quartz.Impl.Matchers;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ZYing.QPanel
{
    public interface IExecutionHistoryStore
    {
        string SchedulerName { get; set; }
        Task<int> GetTotalJobsExecuted();
        Task<int> GetTotalJobsFailed();

        Task IncrementTotalJobsExecuted();
        Task IncrementTotalJobsFailed();
        Task Purge();
        Task<IReadOnlyList<ExecutionHistoryEntry>> FilterLast(FilterInput input);
        Task<ExecutionHistoryEntry> Find(JobKey job, string fireInstanceId);
        Task Save(ExecutionHistoryEntry entry);
        Task PushStatus(JobKey job, string fireInstanceId, DateTimeOffset time, string status);
        Task<ExecutionLogEntry> FindLastLog(JobKey job, string fireInstanceId);
        Task<IReadOnlyList<ExecutionLogEntry>> GetLogs(JobKey job, string fireInstanceId);
    }
}
